<template>

	<el-main style="padding:0 20px;">
		<el-descriptions :column="1" border>
			<el-descriptions-item label="操作人">{{data.user?.nickname}}</el-descriptions-item>
			<el-descriptions-item label="客户端IP">{{data.client_ip}}</el-descriptions-item>
			<el-descriptions-item label="请求接口">{{data.url}}</el-descriptions-item>
			<el-descriptions-item label="请求方法">{{data.method}}</el-descriptions-item>
			<el-descriptions-item label="状态代码">{{data.status}}</el-descriptions-item>
			<el-descriptions-item label="日志名">{{data.title}}</el-descriptions-item>
			<el-descriptions-item label="日志时间">{{data.created_at}}</el-descriptions-item>
		</el-descriptions>
		<el-collapse v-model="activeNames" style="margin-top: 20px;">
			<el-collapse-item title="请求参数" name="1">
				<div class="code">{{data.data}}</div>
			</el-collapse-item>
			<el-collapse-item title="详细" name="2">
				<div class="code">
					{{data.browser}}
				</div>
			</el-collapse-item>
		</el-collapse>
	</el-main>
</template>

<script>
	export default {
		data() {
			return {
				data: {},
				activeNames: ['1'],
				typeMap: {
					'info': "info",
					'warn': "warning",
					'error': "error"
				}
			}
		},
		methods: {
			setData(data){
				this.data = data
			}
		}
	}
</script>

<style scoped>
	.code {background: #848484;padding:15px;color: #fff;font-size: 12px;border-radius: 4px;}
</style>
